#include <iostream>
#include "log.h"

int main()
{
    SYS_LOG(_TRACE) << "Application started" << '\n';
    SYS_LOG(_INFO) << "Debug information: " << 42 << '\n';

    int value = 100;
    SYS_LOG(_DEBUG) << "Debug information: " << "Tracing value: " << value << '\n';
    
    // 条件日志
    bool condition = true;
    SYS_LOG_IF(_WARN, condition) << "Condition is true" << '\n';

    // 定期日志（每10次记录一次）
    for (int i = 0; i < 12; i++) {
        SYS_LOG_EVERY_N(_ERROR, 10) << "Iteration: " << i << '\n';
    }
    
    // 错误处理
    try {
        // 某些可能抛出异常的操作
        throw std::runtime_error("Test exception");
    } catch (const std::exception& e) {
        SYS_LOG(_FATAL) << "Caught exception: " << e.what() << '\n';
    }

    // 毫秒级显示
    SYS_LOG_MS(_INFO) << "This is a millisecond precision log entry." << '\n';
    return 0;
}
